<template>
	<view style="background: #ededed;height: 100vh;">
		<view class="container">
			<view class="top_head">
				<u-dropdown>
					<u-dropdown-item v-model="value" title="距离" :options="options"></u-dropdown-item>
				</u-dropdown>
			</view>
			<view style="margin-top: 40rpx;">
				<view class="text_container">
					<up-text class="left-text" size=18 :bold="true" text="检索历史"></up-text>
					<up-text class="right-text" align="right" suffixIcon="trash" iconStyle="20px" text=""></up-text>
				</view>
				<view class="spacer" style="height: 30rpx;"></view>
				<view class="history-list">
					<view class="history" v-for="(item, index) in historyList" :key="index">
						<up-text :lines="1" :text="item" size="30rpx" align=center></up-text>
					</view>
				</view>
			</view>
			<view class="spacer" style="height: 30rpx;"></view>
			<up-text class="left-text" size=18 :bold="true" text="热门搜索"></up-text>
			<view class="hot_list">
				<view class="hot" v-for="(item, index) in indexList" :key="index">
					<up-text style="margin-top: 30rpx;" :text="`${index+1}.${item}`" size="30rpx"></up-text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				value: 1,
				options: [{
						label: '默认排序',
						value: 1,
					},
					{
						label: '距离优先',
						value: 2,
					},
					{
						label: '价格优先',
						value: 3,
					}
				],
				historyList: ["我的家乡afsaasfasfafsafsafsa", "历史", "岁月如果", "我的家乡afsaasfasfafsafsafsa", "历史", "岁月如果",
					"我的家乡afsaasfasfafsafsafsa", "历史", "岁月如果", "我的家乡afsaasfasfafsafsafsa", "历史", "岁月如果"
				],
				indexList: ["爱由此", "比如", "啦啦啦", "岁月如歌", "光辉岁月", "爱由此", "比如", "啦啦啦", "岁月如歌", "光辉岁月"],
			}
		},
		onLoad() {

		},
		methods: {},
	}
</script>

<style lang="scss">
	.container {
		padding: 10rpx;
	}

	.spacer {
		background-color: transparent;
	}

	.top_head {
		margin-top: 10rpx;
		height: 450rpx;
		background: #ffffff;
		border-radius: 20rpx;
	}

	.text_container {
		display: flex;
		justify-content: space-between;
		align-items: left;
	}

	.left-text,
	.right-text {
		margin: 0 15rpx;
	}

	.history-list {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
	}

	.history {
		margin-left: 20rpx;
		height: 40rpx;
		width: 190rpx;
		margin-top: 20rpx;
		border-radius: 50rpx 50rpx 50rpx 50rpx;
		background: #ffffff;
	}

	.hot_list {
		display: flex;
		flex-wrap: wrap;
	}

	.hot {
		flex: 0 0 50%;
		height: 50rpx;
		text-align: center;
		margin-top: 20rpx;
		padding: 20rpx;
		box-sizing: border-box;
	}
</style>